package com.kmxd.ams.infra.arrange.entity;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.kmxd.ams.core.common.field.ExtField;
import com.kmxd.ams.infra.arrange.base.SystemBO;
import io.swagger.v3.oas.annotations.media.Schema;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.apache.ibatis.type.JdbcType;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 文件级 // @TableName("f1_1_document")
 *
 * @author ZuoLG
 * @since 2022-07-20
 */
@EqualsAndHashCode(callSuper = true)
@Schema(description = "文件级")
@Data
@ToString(callSuper = true)
@TableName("f0_0_document")
public class Document extends SystemBO implements Serializable {

  private static final long serialVersionUID = 1L;

  @Schema(description = "盒号")
  @TableField(updateStrategy = FieldStrategy.IGNORED)
  private String boxNo;

  @Schema(description = "项目代号")
  @TableField(updateStrategy = FieldStrategy.IGNORED)
  private String projCode;

  @Schema(description = "所属卷号")
  @TableField(updateStrategy = FieldStrategy.IGNORED)
  private String volArchCode;

  @Schema(description = "目录号")
  @TableField(updateStrategy = FieldStrategy.IGNORED)
  private String catalogCode;

  @Schema(description = "归档人id")
  private String filling;

  @Schema(description = "四性检测报告ID")
  @JsonSerialize(using = ToStringSerializer.class)
  private Long fourCheckId;

  @Schema(description = "检测状态")
  private Integer fourCheckResult;

  @Schema(description = "检测详情")
  private String fourCheckInfo;

  @Schema(description = "长期保存关联ID")
  @JsonSerialize(using = ToStringSerializer.class)
  private Long longtermPreservationId;

  @Schema(description = "长期保存状态")
  @JsonSerialize(using = ToStringSerializer.class)
  private Integer longtermPreservationStatus;

  @Schema(description = "实体归档情况")
  @JsonSerialize(using = ToStringSerializer.class)
  private Integer physicalType;

  @Schema(description = "实体类别")
  @JsonSerialize(using = ToStringSerializer.class)
  private String physicalCategory;

  @Schema(description = "跨单位移交单ID")
  @JsonSerialize(using = ToStringSerializer.class)
  private Long transferId;

  @Schema(description = "跨单位移交状态")
  @JsonSerialize(using = ToStringSerializer.class)
  private Integer transferStatus;

  @Schema(description = "档号")
  @TableField(updateStrategy = FieldStrategy.IGNORED)
  private String archCode;

  @Schema(description = "责任者")
  private String author;

  @Schema(description = "分类号")
  @TableField(updateStrategy = FieldStrategy.IGNORED)
  private String classfy;

  @Schema(description = "分类名称")
  @TableField(updateStrategy = FieldStrategy.IGNORED)
  private String classfyName;

  @Schema(description = "日期")
  @JsonFormat(timezone = "GMT+8", pattern = "yyyyMMdd")
  @DateTimeFormat(pattern = "yyyyMMdd")
  private Date docDate;

  @Schema(description = "文号")
  private String docNumber;

  @Schema(description = "件号(档号中固定流水字段")
  @JsonSerialize(using = ToStringSerializer.class)
  @TableField(updateStrategy = FieldStrategy.IGNORED)
  private Integer docSequence;

  @Schema(description = "归档日期")
  @JsonFormat(timezone = "GMT+8", pattern = "yyyyMMdd")
  @DateTimeFormat(pattern = "yyyyMMdd")
  private Date fillingDate;

  @Schema(description = "归档部门")
  private String fillingDepartment;

  @Schema(description = "归档份数")
  @JsonSerialize(using = ToStringSerializer.class)
  private Integer fillingNum;

  @Schema(description = "归档人")
  private String fillingPerson;

  @Schema(description = "页数")
  @JsonSerialize(using = ToStringSerializer.class)
  private Integer pageNum;

  @Schema(description = "文件形态")
  private String fileType;

  @Schema(description = "互见号")
  private String relateCode;

  @Schema(description = "备注")
  private String remarks;

  @Schema(description = "保管期限")
  @TableField(updateStrategy = FieldStrategy.IGNORED)
  private String retentionPeriod;

  @Schema(description = "密级")
  @TableField(updateStrategy = FieldStrategy.IGNORED)
  private String security;

  @Schema(description = "题名")
  private String title;

  @Schema(description = "年度")
  @JsonSerialize(using = ToStringSerializer.class)
  @TableField(updateStrategy = FieldStrategy.IGNORED)
  private Integer year;

  @Schema(description = "数字化(否、是)")
  private String digital;

  @Schema(description = "电子文件数量")
  @JsonSerialize(using = ToStringSerializer.class)
  private Integer filesNum;

  @Schema(description = "历史状态")
  @JsonSerialize(using = ToStringSerializer.class)
  private Long historyStatus;

  @Schema(description = "数字扩展字段1")
  @JsonSerialize(using = ToStringSerializer.class)
  @ExtField(value = "ext_int1", jdbcType = JdbcType.BIGINT, length = 11)
  private Integer extInt1;

  @Schema(description = "数字扩展字段2")
  @JsonSerialize(using = ToStringSerializer.class)
  @ExtField(value = "ext_int2", jdbcType = JdbcType.BIGINT, length = 11)
  private Integer extInt2;

  @Schema(description = "数字扩展字段3")
  @JsonSerialize(using = ToStringSerializer.class)
  @ExtField(value = "ext_int3", jdbcType = JdbcType.BIGINT, length = 11)
  private Integer extInt3;

  @Schema(description = "数字扩展字段4")
  @JsonSerialize(using = ToStringSerializer.class)
  @ExtField(value = "ext_int4", jdbcType = JdbcType.BIGINT, length = 11)
  private Integer extInt4;

  @Schema(description = "数字扩展字段5")
  @JsonSerialize(using = ToStringSerializer.class)
  @ExtField(value = "ext_int5", jdbcType = JdbcType.BIGINT, length = 11)
  private Integer extInt5;

  @Schema(description = "日期扩展字段1")
  @ExtField(value = "ext_date1", jdbcType = JdbcType.TIME)
  @JsonFormat(timezone = "GMT+8", pattern = "yyyyMMdd")
  @DateTimeFormat(pattern = "yyyyMMdd")
  private Date extDate1;

  @Schema(description = "日期扩展字段2")
  @ExtField(value = "ext_date2", jdbcType = JdbcType.TIME)
  @JsonFormat(timezone = "GMT+8", pattern = "yyyyMMdd")
  @DateTimeFormat(pattern = "yyyyMMdd")
  private Date extDate2;

  @Schema(description = "日期扩展字段3")
  @ExtField(value = "ext_date3", jdbcType = JdbcType.TIME)
  @JsonFormat(timezone = "GMT+8", pattern = "yyyyMMdd")
  @DateTimeFormat(pattern = "yyyyMMdd")
  private Date extDate3;

  @Schema(description = "日期扩展字段4")
  @ExtField(value = "ext_date4", jdbcType = JdbcType.TIME)
  @JsonFormat(timezone = "GMT+8", pattern = "yyyyMMdd")
  @DateTimeFormat(pattern = "yyyyMMdd")
  private Date extDate4;

  @Schema(description = "日期扩展字段5")
  @ExtField(value = "ext_date5", jdbcType = JdbcType.TIME)
  @JsonFormat(timezone = "GMT+8", pattern = "yyyyMMdd")
  @DateTimeFormat(pattern = "yyyyMMdd")
  private Date extDate5;

  @Schema(description = "字符扩展字段1")
  @ExtField(value = "ext_str1", jdbcType = JdbcType.VARCHAR, length = 64)
  private String extStr1;

  @Schema(description = "字符扩展字段2")
  @ExtField(value = "ext_str2", jdbcType = JdbcType.VARCHAR, length = 64)
  private String extStr2;

  @Schema(description = "字符扩展字段3")
  @ExtField(value = "ext_str3", jdbcType = JdbcType.VARCHAR, length = 64)
  private String extStr3;

  @Schema(description = "字符扩展字段4")
  @ExtField(value = "ext_str4", jdbcType = JdbcType.VARCHAR, length = 64)
  private String extStr4;

  @Schema(description = "字符扩展字段5")
  @ExtField(value = "ext_str5", jdbcType = JdbcType.VARCHAR, length = 64)
  private String extStr5;

  @Schema(description = "字符扩展字段6")
  @ExtField(value = "ext_str6", jdbcType = JdbcType.VARCHAR, length = 64)
  private String extStr6;

  @Schema(description = "字符扩展字段7")
  @ExtField(value = "ext_str7", jdbcType = JdbcType.VARCHAR, length = 64)
  private String extStr7;

  @Schema(description = "字符扩展字段8")
  @ExtField(value = "ext_str8", jdbcType = JdbcType.VARCHAR, length = 64)
  private String extStr8;

  @Schema(description = "字符扩展字段9")
  @ExtField(value = "ext_str9", jdbcType = JdbcType.VARCHAR, length = 64)
  private String extStr9;

  @Schema(description = "字符扩展字段10")
  @ExtField(value = "ext_str10", jdbcType = JdbcType.VARCHAR, length = 64)
  private String extStr10;

  @Schema(description = "是否是散文件")
  @TableField(exist = false)
  private Boolean scatteredStatus;

  @Schema(description = "统计-用户数据库字段对应")
  @JsonSerialize(using = ToStringSerializer.class)
  @TableField(exist = false)
  private Long total;
}
